From: Carlos Garnacho Date: Fri, 16 Oct 2015 16:03:30 +0000 (+0200) Subject: popupMenu: Fix touch handling of PopupSubMenuMenuItem X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1045 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=67afd7a6d82e300bae74b7539e6dfc3341f73a23;p=gnome-shell.git popupMenu: Fix touch handling of PopupSubMenuMenuItem It overrides ::button-release-event in order to implement the hidden/shown toggling, it must do the same on TOUCH_END, otherwise menus stay shown on touch. https://bugzilla.gnome.org/show_bug.cgi?id=756748 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 05f82b8ef..0090aa3b2 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1146,6 +1146,16 @@ const PopupSubMenuMenuItem = new Lang.Class({ this.actor.remove_style_pseudo_class ('active'); this._setOpenState(!this._getOpenState()); return Clutter.EVENT_PROPAGATE; + }, + + _onTouchEvent: function(actor, event) { + if (event.type() == Clutter.EventType.TOUCH_END) { + // Since we override the parent, we need to manage what the parent does + // with the active style class + this.actor.remove_style_pseudo_class ('active'); + this._setOpenState(!this._getOpenState()); + } + return Clutter.EVENT_PROPAGATE; } });